<extend name="Public/List/Common"/>
<block name="pageHeader">
    <div class="bjui-pageHeader">
        <form id="pagerForm" data-toggle="ajaxsearch" action="{:U('index')}" method="post">
            <div class="bjui-searchBar">
                <label>筛选:</label>
                <select name="key" data-toggle="selectpicker">
                    <option value="username"
                    <if condition="$_REQUEST['key']=='username'">selected</if>
                    > 用户名</option>
                    <option value="mobile"
                    <if condition="$_REQUEST['key']=='mobile'">selected</if>
                    > 手机号</option>
                </select>
                <label>关键词：</label>
                <input value="{$_REQUEST['value']}" name="value" class="form-control" size="15"/>
                <button type="submit" class="btn-default" data-icon="search">查询</button>
                <div class="pull-right">
                    <a href="{:U('add')}" class="btn btn-green" data-toggle="dialog" data-width="600" data-height="400"
                       data-id="dialog-normal" data-mask="true" data-title="新增用户">添加</a>
                <span>
                    <a href="{:U('User/outxls')}" class="btn btn-blue" data-toggle="doexport" data-icon="arrow-up"
                       onclick="javascript:exportDialog();">导出</a>
                </span>
                </div>
            </div>
        </form>
    </div>
</block>
<block name="pageContent">
<div class="bjui-pageContent tableContent">
  <table data-toggle="tablefixed" data-width="100%" data-nowrap="true">
    <thead>
      <tr>
        <th width="26"><input type="checkbox" class="checkboxCtrl" data-group="ids" data-toggle="icheck"></th>
        <th>序号</th>
        <th>微信名</th>
        <th>别名</th>
        <th>用户身份</th>
        <th>公司</th>
        <th>手机</th>
		<th>邮箱</th>
		<th>状态</th>
		<th>所属父级</th>
        <!--<th data-order-direction="asc" data-order-field="last_login_time">最后登录时间</th>-->
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
    <notempty name="_list">
        <volist name="_list" id="vo">
            <tr data-id="{$vo.uid}">
				<?php $group_ids=explode(',', $vo['group_ids']);?>
                <td><input type="checkbox" name="ids" data-toggle="icheck" value="{$vo.uid}"></td>
                <td>{$vo.uid|default=$vo['id']}</td>
            	<td>{$vo.username}</td>
                <td>{$vo.alias|default=$vo['nickname']}</td>
                    <td>
                        <?php if($group_ids && count($group_ids)>1):?>
                            <volist name="group_ids" id="v">
                                {:getColumnNameForModel($v, 'AuthGroup', 'title')},
                            </volist>
                        <?php elseif($group_ids && count($group_ids)==1):?>
                        {:getColumnNameForModel(current($group_ids), 'AuthGroup', 'title')}
                        <?php endif;?>
                    </td>
                <td>{$vo.business_name}</td>
                <td>{$vo.mobile}</td>
                <td>{$vo.email}</td>
                <td>{$vo.status|columnToName="DEFAULE_STATUS",###}</td>
                <td>{:getColumnNameForModel($vo['pid'], 'UcenterMember', 'username')}</td>
                <!--<td>{$vo.last_login_time|time_format}</td>-->
                <td>
                    <a href="{:U('editUserInfo', array('id'=>$vo['uid'], 'pid'=>$vo['pid']))}" class="btn btn-green" data-toggle="dialog"
                           data-width="600" data-height="400" data-id="dialog-normal" data-mask="true" data-title="{$vo.username}-编辑">基本信息</a>
                    <a href="{:U('User/changeStatus?method=deleteUser&id='.$vo['uid'])}" class="btn btn-red"  data-toggle="doajax" data-confirm-msg="确定要删除该行信息吗？">删</a>
                    <a href="{:U('actionLog?id='.$vo['uid'])}" class="btn btn-green" data-toggle="navtab" data-id="add{$vo['id']}"  data-title="{$vo.nickname}用户行为">用户行为</a>
                </td>
            </tr>
        </volist>
      <else/>
            <td colspan="9" class="text-center"> aOh! 暂时还没有用户! </td>
      </notempty>
      </tbody>
  </table>
</div>
</block>
